<script type="text/javascript">
    RED.nodes.registerType('sheet-to-json',{
        category: 'Spreadsheet',
        color: "#DEBD5C",
        defaults: {
            name: {value:""},
            raw: {value:"false", required:true},
            range: {value:""},
            header: {value:"default", required:true},
            blankrows: {value:false, required:true}
        },
        inputs:1,
        outputs:1,
        icon: "font-awesome/fa-sign-out",
        label: function() {
            return this.name||"sheet to json";
        },
        labelStyle: function() {
            return this.name?"node_label_italic":"";
        },
        inputLabels: function() {
            return this._("sheet-to-json.label.sheetObject");
        },
        outputLabels: function () {
            return this._("sheet-to-json.label.cellValues");
        }
    });
</script>

<script type="text/x-red" data-template-name="sheet-to-json">
    <div class="form-row">
        <label for="node-input-name"><i class="icon-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
        <input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
    </div>
    <div class="form-row">
        <label for="node-input-raw"><i class="fa fa-sign-out"></i> <span data-i18n="sheet-to-json.label.raw"></span></label>
        <select id="node-input-raw">
            <option value="false" data-i18n="sheet-to-json.raw.false"></option>
            <option value="true" data-i18n="sheet-to-json.raw.true"></option>
        </select>
    </div>
    <div class="form-row">
        <label for="node-input-range"><i class="fa fa-th-large"></i> <span data-i18n="sheet-to-json.label.range"></span></label>
        <input type="text" id="node-input-range" data-i18n="[placeholder]sheet-to-json.placeholder.range">
    </div>
    <div class="form-row">
        <label for="node-input-header"><i class="fa fa-columns"></i> <span data-i18n="sheet-to-json.label.header"></span></label>
        <select id="node-input-header" style="width: 70%">
            <option value="1" data-i18n="sheet-to-json.header.1"></option>
            <option value="A" data-i18n="sheet-to-json.header.A"></option>
            <option value="default" data-i18n="sheet-to-json.header.default"></option>
        </select>
    </div>
    <div class="form-row">
        <label><i class="fa fa-bars"></i> <span data-i18n="sheet-to-json.label.blankrows"></span></label>
        <input type="checkbox" id="node-input-blankrows" style="width:auto">
        <label for="node-input-blankrows" style="width:auto" data-i18n="sheet-to-json.blankrows.include"></label>
    </div>
</script>
